/* 
 * File:   ServiceLocator.h
 * Author: vasilis
 *
 * Created on August 10, 2011, 4:29 PM
 */

#ifndef SERVICELOCATOR_H
#define	SERVICELOCATOR_H


template <class ServiceType>
class ServiceLocator
{
private:
    
    static ServiceType *m_service;

public:

    /**
     * Sets the object that implements the Service.
     * @param service
     */

    static void SetService(ServiceType *service)
    {
        m_service = service;
    }


    /**
     * Gets a handle to the service provider.
     *
     * @return
     */

    static ServiceType* GetService()
    {
        return m_service;
    }
};

template <class ServiceType>
ServiceType* ServiceLocator<ServiceType>::m_service = 0;

#endif	/* SERVICELOCATOR_H */

